package qianfeng.com.meijiadaka.viewholder;

import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.bumptech.glide.Glide;

import cn.lemon.view.adapter.BaseViewHolder;
import qianfeng.com.meijiadaka.R;
import qianfeng.com.meijiadaka.bean.OneDayBean;

/**
 * Created by yanshihao on 2017/2/10.
 */

public class Tutorial_ViewHolder extends BaseViewHolder<OneDayBean.ResultBean> {

    private ImageView iv;
    TextView tv;

    public Tutorial_ViewHolder(ViewGroup parent) {
        super(parent, R.layout.oneday);
    }

    @Override
    public void onInitializeView() {
        super.onInitializeView();
        iv = (ImageView)findViewById(R.id.oneday_iv);
        tv = (TextView)findViewById(R.id.oneday_tv);
    }

    @Override
    public void setData(OneDayBean.ResultBean object) {
        super.setData(object);
        tv.setText(object.getTitle());
        Glide.with(itemView.getContext()).load(object.getThumbUrl()).into(iv);
    }

    @Override
    public void onItemViewClick(OneDayBean.ResultBean object) {
        super.onItemViewClick(object);
        Toast.makeText(itemView.getContext(),"点解",Toast.LENGTH_SHORT).show();
    }
}
